package com.xyw.his00.utils.FileUtils;

import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*;
import com.xyw.his00.utils.TimeUtils.DateUtil;
import com.xyw.his00.utils.TimeUtils.LocalDateTimeRevertStringUtil;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PdfGeneratorUtil {

    private String id;
    private String registerId;
    private String typeId;
    private String outTradeNo;
    private String type;
    private String registerName;
    private String orderNumber;
    private String realName;
    private String techPrice;
    private String totalAmount;
    private String selectedChoices; // 注意拼写，应与前端一致或修正前端代码
    private String subject;
    private String count;
    private String status;

    public PdfGeneratorUtil(Map<String, String> allParams) {
        this.id = allParams.get("id");
        this.registerId = allParams.get("registerId");
        this.typeId = allParams.get("typeId");
        this.outTradeNo = allParams.get("outTradeNo");
        this.type = allParams.get("type");
        this.registerName = allParams.get("registerName");
        this.orderNumber = allParams.get("orderNumber");
        this.realName = allParams.get("realName");
        this.techPrice = allParams.get("techPrice");
        this.totalAmount = allParams.get("totalAmount");
        this.selectedChoices = allParams.get("selectdChoises"); // 注意拼写，应与前端一致或修正前端代码
        this.subject = allParams.get("subject");
        this.count = allParams.get("count");
        this.status = allParams.get("status");
    }


}